﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;

namespace GymMaster
{
    public partial class gymmaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session.Timeout = 5;
                Session["Usuario"] = " Faça seu login.";
                Session["ModuloAtivo"] = "";
            }

            lblNome.Text = Session["Usuario"].ToString();
        }

        protected void lnkAdministracao_Click(object sender, EventArgs e)
        {
            LinkButton b = (LinkButton)sender;
            string[] nome = b.ID.Split('1');
            Session["ModuloAtivo"] = "Administracao";
            IndicaMenus();
            String url = "~/View/" + nome[0] + "/" + nome[1] + ".aspx";
            Response.Redirect(url);
        }

        private void IndicaMenus() {
            String modulo = Session["ModuloAtivo"].ToString();
            switch (modulo) { 
                case "Administracao":
                    lblNome.Text = "teste";
                    Aluno1Aluno.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Alunos":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Mensalidade":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Venda":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Relatorios":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Contato":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                case "Ajuda":
                    Administracao1Administracao.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);
                    return;
                default:
                    return;
            }
        }
    }
}
